<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue component实例父子组件</title>
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>
<body>
<h1>Vue component实例父子组件</h1>
<hr>
<div id="app">
    <panda></panda>
</div>
<script type="text/javascript">
  //子组件
  var cityComponent = {
    template: `
        <div>
            <p style="color: green;"> siChuan of China!</p>
        </div>
        `
  }
  //父组件
  var pandaComponent = {
    template: `
        <div>
            <p style="color: red;"> panda from China!</p>
            <city></city>
        </div>
        `,
    components: {
      'city': cityComponent
    }
  }

  var app = new Vue({
    el: '#app',
    data: {
      message: 'hello world!'
    },
    components: {
      'panda': pandaComponent
    }
  })
</script>
</body>
</html>